UI: Fix listing of resources for ASG belonging to a project#13187
UI: Fix listing of resources for ASG belonging to a project#13187vishesh92 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.20 #13187 +/- ##
============================================
- Coverage 16.27% 16.26% -0.01%
+ Complexity 13440 13436 -4
============================================
Files 5665 5667 +2
Lines 500555 500719 +164
Branches 60789 60804 +15
============================================
- Hits 81445 81425 -20
- Misses 410004 410184 +180
- Partials 9106 9110 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| const params = { | ||
| listAll: true, | ||
| id: this.resource.id | ||
| }).then(response => { | ||
| } | ||
| if (this.resource.projectid) { | ||
| params.projectid = this.resource.projectid | ||
| } | ||
| api('listAutoScaleVmGroups', params).then(response => { |
There was a problem hiding this comment.
this change happens a lot. should it be a method?
|
@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
weizhouapache
left a comment
There was a problem hiding this comment.
code lgtm
there will be some conflicts when porting to 4.22/main
There was a problem hiding this comment.
Pull request overview
This PR fixes missing project scoping in AutoScale UI components so that ASG-related resources (VM profiles, policies, LB rules) are correctly listed when the ASG belongs to a project, and improves template name display for project-scoped templates.
Changes:
- Adds
projectidto several AutoScale-related API requests when the current resource is project-scoped. - Updates AutoScale VM profile UI to resolve template names via
listTemplates(instead of relying only on a locally loaded list). - Refreshes AutoScale VM profile data after updates and adjusts modal/update flow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ui/src/views/compute/AutoScaleVmProfile.vue | Adds project-aware params, introduces template-name resolution via API, and refreshes profile data on update. |
| ui/src/views/compute/AutoScaleUpPolicyTab.vue | Adds projectid to VM group / LB rule / policy listing calls for project-scoped ASGs. |
| ui/src/views/compute/AutoScaleDownPolicyTab.vue | Adds projectid to VM group / LB rule / policy listing calls for project-scoped ASGs. |
| ui/src/views/compute/AutoScaleLoadBalancing.vue | Adds projectid to LB rule and ASG listing calls under Load Balancing view. |
Comments suppressed due to low confidence (1)
ui/src/views/compute/AutoScaleLoadBalancing.vue:538
fetchAutoScaleVMgroupsflipsthis.loadingtofalsein each per-rule request’sfinally(), so the loading state can become false while otherlistAutoScaleVmGroupscalls are still in flight. This makes the UI loading indicator inaccurate (especially with multiple LB rules).
fetchAutoScaleVMgroups () {
this.loading = true
this.lbRules.forEach(rule => {
const params = {
listAll: true,
lbruleid: rule.id
}
if (this.resource.projectid) {
params.projectid = this.resource.projectid
}
api('listAutoScaleVmGroups', params).then(response => {
rule.autoscalevmgroup = response.listautoscalevmgroupsresponse?.autoscalevmgroup?.[0]
}).finally(() => {
this.loading = false
})
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@vishesh92 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
Description
This PR fixes #12978
This PR resolves missing project scopes issues within the AutoScale UI components (AutoScaleVmProfile.vue, AutoScaleUpPolicyTab.vue, and AutoScaleDownPolicyTab.vue).
Generated Summary
This pull request improves the handling of project-scoped resources and enhances template name resolution in the AutoScale UI components. The main changes ensure that API requests include the
projectidparameter when relevant, and that template names are accurately fetched and displayed, especially when templates may not be present in the local list.Project-aware API requests:
All API calls in
AutoScaleDownPolicyTab.vue,AutoScaleUpPolicyTab.vue, andAutoScaleLoadBalancing.vuenow include theprojectidparameter if the resource is part of a project. This ensures correct data retrieval in multi-project environments. [1] [2] [3] [4] [5] [6] [7] [8]Similar updates in
AutoScaleVmProfile.vueaddprojectidto template, VM profile, and related API requests for project-scoped resources. [1] [2] [3]Template name resolution improvements:
listTemplates) to fetch the template name bytemplateid. If the template is not found, the rawtemplateidis displayed as a fallback. [1] [2] [3] [4]UI/UX enhancements:
These changes collectively improve the correctness and user experience of the AutoScale UI, especially for users working with project resources.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?